package com.scalar.chiptrack.finance.openpo;

import com.scalar.chiptrack.finance.openpo.PurchaseOrderLineItemLotDataEntryList;

import java.util.ArrayList;
import java.text.DecimalFormat;

/**
 * Created by IntelliJ IDEA.
 * Author: Phani Raja Kumar
 * Date  : Feb 17, 2005
 * Time  : 12:59:01 PM
 * To change this template use Options | File Templates.
 */
public class PurchaseOrderLineItem {
	private int purchaseOrderLineItem_Id;
    private int purchaseOrderLineItemNumber;
    private String processName;
    private String partNumber;
    private String customerPartNumber;
    private int processStepId;
    private String description;
    private String packageType;
    private String requestedDate;
    private String promisedDate;
    private long requestedQuantity;
    private long previouslyShipppedQty;
    private long shippedQty;
    private double unitCost;
    private double extendedCost;
    private String status;
    private boolean cancel;

    //added by Murali Krishna
    private boolean prevCancel;

    private ArrayList partNumbersList = null;
    private ArrayList partDescriptionList = null;
    
    private int financeHold 		= -1;
    private int operationsHold 		= -1;

    private PurchaseOrderLineItemLotDataEntryList purchaseOrderLineItemLotDataEntryList;

    public PurchaseOrderLineItem() {
		purchaseOrderLineItem_Id = -1;
        purchaseOrderLineItemNumber = 1;
        processStepId = -1;
        processName = null;
        partNumber = null;
        description = null;
        packageType = null;
        requestedDate = null;
        promisedDate = null;
        requestedQuantity = 0;
        previouslyShipppedQty = 0;
        shippedQty = 0;
        unitCost = 0;
        extendedCost = 0;
        status = "";
        cancel = false;
		financeHold = -1;
		operationsHold = -1;
        partNumbersList = new ArrayList();
		partDescriptionList = new ArrayList();
		purchaseOrderLineItemLotDataEntryList = new PurchaseOrderLineItemLotDataEntryList();
    }
	/**
	 * @return
	 */
	public boolean getCancel()
	{
		return cancel;
	}

    /**
     * 
     * @return
     */
    public boolean isPrevCancel() {
        return prevCancel;
    }

	/**
	 * @return
	 */
	public String getDescription()
	{
		return description;
	}

	/**
	 * @return
	 */
	public double getExtendedCost()
	{
		return extendedCost;
	}

    public String getExtendedCostAsString()
    {
        DecimalFormat formatter = new DecimalFormat("0.00");
        String output = formatter.format( extendedCost);
        return output;
    }

	/**
	 * @return
	 */
	public String getPackageType()
	{
		return packageType;
	}

	/**
	 * @return
	 */
	public String getPartNumber()
	{
		return partNumber;
	}

    public int getProcessStepId() {
        return processStepId;
    }

	/**
	 * @return
	 */
	public long getPreviouslyShipppedQty()
	{
		return previouslyShipppedQty;
	}

	/**
	 * @return
	 */
	public String getProcessName()
	{
		return processName;
	}

	/**
	 * @return
	 */
	public String getPromisedDate()
	{
		return promisedDate;
	}

	/**
	 * @return
	 */
	public int getPurchaseOrderLineItem_Id()
	{
		return purchaseOrderLineItem_Id;
	}

	/**
	 * @return
	 */
	public int getPurchaseOrderLineItemNumber()
	{
		return purchaseOrderLineItemNumber;
	}

	/**
	 * @return
	 */
	public String getRequestedDate()
	{
		return requestedDate;
	}

	/**
	 * @return
	 */
	public long getRequestedQuantity()
	{
		return requestedQuantity;
	}

	/**
	 * @return
	 */
	public long getShippedQty()
	{
		return shippedQty;
	}

	/**
	 * @return
	 */
	public String getStatus()
	{
		return status;
	}

	/**
	 * @return
	 */
	public double getUnitCost()
	{
		return unitCost;
	}

    /**
     *
     * @return UnitCost as string
     */
    public String getUnitCostAsString()
    {
        DecimalFormat formatter = new DecimalFormat("0.00");
        String output = formatter.format( unitCost );
        return output;
    }

	/**
	 * @param b
	 */
	public void setCancel(boolean b)
	{
		cancel = b;
	}

    /**
     *
     * @param prevCancel
     */
    public void setPrevCancel(boolean prevCancel) {
        this.prevCancel = prevCancel;
    }



	/**
	 * @param string
	 */
	public void setDescription(String string)
	{
		description = string;
	}

	/**
	 * @param l
	 */
	public void setExtendedCost(double l)
	{
		extendedCost = l;
	}

	/**
	 * @param string
	 */
	public void setPackageType(String string)
	{
		packageType = string;
	}

	/**
	 * @param string
	 */
	public void setPartNumber(String string)
	{
		partNumber = string;
	}

    public void setProcessStepId(int processStepId) {
        this.processStepId = processStepId;
    }

	/**
	 * @param previouslyShipppedQty
	 */
	public void setPreviouslyShipppedQty(long previouslyShipppedQty)
	{
		this.previouslyShipppedQty = previouslyShipppedQty;
	}

	/**
	 * @param string
	 */
	public void setProcessName(String string)
	{
		processName = string;
	}

	/**
	 * @param string
	 */
	public void setPromisedDate(String string)
	{
		promisedDate = string;
	}

	/**
	 * @param i
	 */
	public void setPurchaseOrderLineItem_Id(int i)
	{
		purchaseOrderLineItem_Id = i;
	}

	/**
	 * @param i
	 */
	public void setPurchaseOrderLineItemNumber(int i)
	{
		purchaseOrderLineItemNumber = i;
	}

	/**
	 * @param string
	 */
	public void setRequestedDate(String string)
	{
		requestedDate = string;
	}

	/**
	 * @param requestedQuantity
	 */
	public void setRequestedQuantity(long requestedQuantity)
	{
		this.requestedQuantity = requestedQuantity;
	}

	/**
	 * @param shippedQty
	 */
	public void setShippedQty(long shippedQty)
	{
		this.shippedQty = shippedQty;
	}

	/**
	 * @param l
	 */
	public void setStatus(String l)
	{
		status = l;
	}

	/**
	 * @param l
	 */
	public void setUnitCost(double l)
	{
		unitCost = l;
	}

    public ArrayList getPartNumbersList() {
        return partNumbersList;
    }

    public void setPartNumbersList(ArrayList partNumbersList) {
        this.partNumbersList = partNumbersList;
    }

    /**
     * @return
     */
    public int getFinanceHold()
    {
        return financeHold;
    }

    /**
     * @return
     */
    public int getOperationsHold()
    {
        return operationsHold;
    }

    /**
     * @param i
     */
    public void setFinanceHold(int i)
    {
        financeHold = i;
    }

    /**
     * @param i
     */
    public void setOperationsHold(int i)
    {
        operationsHold = i;
    }

    public PurchaseOrderLineItemLotDataEntryList getPurchaseOrderLineItemLotDataEntryList() {
        return purchaseOrderLineItemLotDataEntryList;
    }

    public void setPurchaseOrderLineItemLotDataEntryList(PurchaseOrderLineItemLotDataEntryList purchaseOrderLineItemLotDataEntryList) {
        this.purchaseOrderLineItemLotDataEntryList = purchaseOrderLineItemLotDataEntryList;
    }



	/**
	 * @return
	 */
	public ArrayList getPartDescriptionList()
	{
		return partDescriptionList;
	}

	/**
	 * @param list
	 */
	public void setPartDescriptionList(ArrayList list)
	{
		partDescriptionList = list;
	}
	/**
	 * @return Returns the customerPartNumber.
	 */
	public String getCustomerPartNumber() {
		return customerPartNumber;
	}
	/**
	 * @param customerPartNumber The customerPartNumber to set.
	 */
	public void setCustomerPartNumber(String customerPartNumber) {
		this.customerPartNumber = customerPartNumber;
	}
}
